<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/6/18
  Time: 20:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>搜素条件</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui/css/layui.css">
</head>
<body>
<form class="layui-form">
    <input type="hidden" name="id" value="${customer.id}">
    <div class="layui-form-item">
        <label class="layui-form-label">客户名称</label>
        <div class="layui-input-inline">
            <%--lay-verify="required" 表示表单验证，必填--%>
            <input type="text" name="name" placeholder="客户名称" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">客户状态</label>
            <div class="layui-input-inline">
                <select name="status" lay-search="">
                    <option value="">请选择</option>
                    <option value="潜在客户">潜在客户</option>
                    <option value="成交客户">成交客户</option>
                    <option value="意向客户">意向客户</option>
                    <option value="失败客户">失败客户</option>
                    <option value="已流失客户">已流失客户</option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">客户类别</label>
            <div class="layui-input-inline">
                <select name="type" lay-search="">
                    <option value="">请选择</option>
                    <option value="普通客户">普通客户</option>
                    <option value="VIP客户">VIP客户</option>
                    <option value="老客户">老客户</option>
                    <option value="代理商">代理商</option>
                    <option value="供货商">供货商</option>
                    <option value="合作伙伴">合作伙伴</option>
                    <option value="其他">其他</option>
                </select>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">客户来源</label>
            <div class="layui-input-inline">
                <select name="source"  lay-search="">
                    <option value="">请选择</option>
                    <option value="注册会员">注册会员</option>
                    <option value="朋友介绍">朋友介绍</option>
                    <option value="客户介绍">客户介绍</option>
                    <option value="电子商务">电子商务</option>
                    <option value="合作伙伴">合作伙伴</option>
                    <option value="广告">广告</option>
                    <option value="职员引介">职员引介</option>
                    <option value="市场活动">市场活动</option>
                    <option value="口头传达">口头传达</option>
                    <option value="其他">其他</option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">客户等级</label>
            <div class="layui-input-inline">
                <select name="levels"  lay-search="">
                    <option value="">请选择</option>
                    <option value="五星客户">五星客户</option>
                    <option value="四星客户">四星客户</option>
                    <option value="三星客户">三星客户</option>
                    <option value="二星客户">二星客户</option>
                    <option value="一星客户">一星客户</option>
                </select>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">客户信用度</label>
            <div class="layui-input-inline">
                <select name="credit"  lay-search="">
                    <option value="">请选择</option>
                    <option value="五星客户">五星客户</option>
                    <option value="四星客户">四星客户</option>
                    <option value="三星客户">三星客户</option>
                    <option value="二星客户">二星客户</option>
                    <option value="一星客户">一星客户</option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">客户成熟度</label>
            <div class="layui-input-inline">
                <select name="maturity"  lay-search="">
                    <option value="">请选择</option>
                    <option value="明确交易意向">A+：明确交易意向</option>
                    <option value="有初步成交意向">A-：有初步成交意向</option>
                    <option value="关键人有成交意向">B+：关键人有成交意向</option>
                    <option value="关键人成交意向不确定">B-：关键人成交意向不确定</option>
                    <option value="初步联系，有意向">C+：初步联系，有意向</option>
                    <option value="初步联系，意向不明确">C-：初步联系，意向不明确</option>
                    <option value="新建客户">D：新建客户</option>
                    <option value="有明显拒绝">E：有明显拒绝</option>
                    <option value="无效客户">F：无效客户</option>
                </select>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <button style="margin-left: 250px" layui-btn-primary lay-submit class="layui-btn" >重置</button>
        <button lay-filter="query" lay-submit class="layui-btn">查询</button>
    </div>
</form>
    <script src="${pageContext.request.contextPath}/static/layui/layui.js" charset="utf-8"></script>
    <script>
        layui.use(['layer','form','table','jquery'],function () {
            var layer = layui.layer
                , form = layui.form;
            var table = layui.table;
            var $ = layui.$;
            //表单提交监听
            form.on("submit(query)",function (data) {
                console.log(data.field);
                //发起异步请求，新增 data.field 表单数据
                $.post("${pageContext.request.contextPath}/customer/customers",function (result) {
                    if (result.code==0){
                        //刷新父窗口的表格 parent 父窗口对象
                        parent.layui.table.reload("roleTable",{
                            where:{//查询条件
                                params:data.field//会封装到LayRequest中的params中去
                            },
                            page:{
                                curr:1
                            }
                        })
                        //关闭本窗口
                        //当你在iframe页面关闭自身时
                        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                        parent.layer.close(index); //再执行关闭
                    }
                    else {
                        layer.msg("数据加载中");
                    }
                },"json");
                return false;//阻止表单跳转。如果需要表单跳转，去掉这段即可。
            })
        });
    </script>
</body>
</html>
